/*

	LevelEditor.h
	
	Main class for the level editor program.
	Handles initialization, program kernel, and
	clean up.
	
	Written by Sigurd Suhm 2009

*/

#ifndef _LEVELEDITOR_H
#define _LEVELEDITOR_H

// Includes
#include "IDevice.h"		// Graphics device header
#include "SceneManager.h"	// Scene manager class header
#include "EventHandler.h"	// Event handler class header
#include "InputDevice.h"	// Input device header
#include "Timer.h"			// Timer class header

namespace EraAstral
{
	using namespace core;
	using namespace graphics;

	namespace tools
	{
		class LevelEditor : public IHasEvents
		{
			private:
				// Indicates if the kernel should keep running
				bool	m_shouldRun;
				// Use vSync?
				bool	m_vSync;				
				int		m_screenRefresh;		// Screen refresh rate
				// Graphics device
				IDevice			*m_device;
				// Scene manager
				SceneManager	*m_smgr;
				// Event handler
				EventHandler	*m_eventHandler;
				// Input device
				InputDevice		*m_input;
				// Timer
				Timer			*m_timer;
		
			public:
				// Default constructor
				LevelEditor();
				// Default destructor
				~LevelEditor();
				
				// Runs the level editor program
				void	Run();
				// Exits the level editor program
				void	Exit();
				
				// Update and draw logic
				void Update();
				void Render();
				
				// Apply vertical synchronization
				void ApplyVSync();
				
				// Process events from the event handler
				void ProcessEventSignal(const Event *event);
		};
	}
}

#endif